# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=origami
pkgver=2.1.0
pkgrel=14
pkgdesc='Aims at providing a scripting tool to generate and analyze malicious PDF files.'
arch=('any')
groups=('blackarch' 'blackarch-malware' 'blackarch-forensic')
url='https://github.com/gdelugre/origami'
license=('LGPL3')
depends=('ruby' 'rubygems' 'ruby-rdoc' 'ruby-colorize')
options=(!emptydirs)
source=("https://rubygems.org/downloads/$pkgname-$pkgver.gem")
noextract=("origami-${pkgver}.gem")
sha512sums=('92ce7006b6368895e252b01b4157d387b5705f5269b3562b83fed1da44ab26a148b1bedbbefc86108825a29a8124295abb4b388175d175f5ff72361d948e01b6')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install \
    -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "origami-$pkgver.gem"

  rm "$pkgdir/$_gemdir/cache/origami-$pkgver.gem"

  install -Dm 644 "$pkgdir/$_gemdir/gems/origami-$pkgver/COPYING.LESSER" \
    "$pkgdir/usr/share/licenses/origami/COPYING.LESSER"
}

